﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Drawing.Text;

namespace Ue.Components.VerificationCode
{
    public class VerifyCodeInterferenceLinesComponent : IVerifyCodeComponent
    {
        private Func<Color> acquireColor;

        public VerifyCodeInterferenceLinesComponent(Func<Color> acquireColor)
        {
            this.acquireColor = acquireColor;
        }

        #region IVerifyCodeComponent 成员

        public int Priority
        {
            get { return 50; }
        }

        public void Draw(ref VerifyImageDrawContext context)
        {
            Pen pen = new Pen(this.acquireColor(), VerifyCodeHolder.GetRandom(2, 4));
            context.Graphics.DrawEllipse(pen, VerifyCodeHolder.GetRandom(5, 25), VerifyCodeHolder.GetRandom(15, 35), VerifyCodeHolder.GetRandom(150, 200), VerifyCodeHolder.GetRandom(60, 100));
        }

        #endregion
    }
}
